package com.example.rlw.mvpplugintest.collapsing;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.example.rlw.mvpplugintest.R;
import com.example.rlw.mvpplugintest.adapter.TestAdapter;
import com.example.rlw.mvpplugintest.mvp.MVPBaseFragment;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * 描述：
 * Created by rlw on 2019/3/11.
 */
public class TestFragment extends MVPBaseFragment {
    @BindView(R.id.recyclerView)
    RecyclerView mRecyclerView;
    private TestAdapter mAdapter;
    private List<String> mList;

    @Override
    public void loadData() {

    }

    @Override
    protected int getLayoutId() {
        return R.layout.test_fragment_layout;
    }

    @Override
    protected void initData(@Nullable Bundle savedInstanceState) {
        mList = new ArrayList<>();
        for (int i = 0; i < 20; i++) {
            mList.add("测试数据" + i);
        }
        mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
        mAdapter = new TestAdapter(R.layout.item_layout, mList);
        mRecyclerView.setAdapter(mAdapter);
    }
}
